package com.dsa.utils;


public class SorterTools {

    private SorterTools() {}

    public static <E extends Comparable<E>> boolean isSorted(E[] data) {
        return !isNotSorted(data);
    }

    public static <E extends Comparable<E>> boolean isNotSorted(E[] data) {
        for (int i = 1; i < data.length; i++) {
            if (data[i].compareTo(data[i - 1]) < 0) {
                return true;
            }
        }
        return false;
    }


}
